import router from './router';
import NProgress from 'nprogress'; // progress bar

NProgress.configure({ showSpinner: false });// NProgress Configuration

const whiteList = ['/404', '/401'];// no redirect whitelist

router.beforeEach((to, from, next) => {
    NProgress.start(); // start progress bar
    next();
});

router.afterEach((to, from) => {
    // 修改query，添加时间戳
    to.query['t'] = new Date().getTime();
    NProgress.done(); // finish progress bar
    // 修改title
    document.title = to.name;
});
